package com.meituan.catering.management.order.remote.model.converter;

import com.meituan.catering.management.order.remote.model.response.ShopDetailRemoteResponse;
import com.meituan.catering.management.product.api.thrift.model.response.ProductDetailThriftResponse;
import com.meituan.catering.management.shop.api.thrift.model.response.ShopDetailThriftResponse;

import java.util.stream.Collectors;

/**
 * 从其他数据模型向订单BO的转换器
 */
public abstract class ShopRemoteConverter {

    public static ShopDetailRemoteResponse fromShopThriftResponse(ShopDetailThriftResponse responseThrift) {

        if (responseThrift == null) {
            return null;
        } else {
            ShopDetailRemoteResponse response = new ShopDetailRemoteResponse();
            response.setId(responseThrift.getId());
            response.setTenantId(responseThrift.getTenantId());
            response.getAuditing().setCreatedBy(responseThrift.getAuditing().getCreatedBy());
            response.getAuditing().setLastModifiedBy(responseThrift.getAuditing().getLastModifiedBy());

            response.setBusinessNo(responseThrift.getBusinessNo());
            response.setName(responseThrift.getName());
            response.setBusinessType(responseThrift.getBusinessType());
            response.getContact().setTelephone(responseThrift.getContact().getTelephone());
            response.getContact().setCellphone(responseThrift.getContact().getCellphone());
            response.getContact().setName(responseThrift.getContact().getName());
            response.getContact().setAddress(responseThrift.getContact().getAddress());
            response.getOpeningHours().setOpenTime(responseThrift.getOpeningHours().getOpenTime());
            response.getOpeningHours().setCloseTime(responseThrift.getOpeningHours().getCloseTime());
            response.setManagementType(responseThrift.getManagementType());
            response.setBusinessArea(responseThrift.getBusinessArea());
            response.setComment(responseThrift.getComment());
            response.setEnabled(responseThrift.getEnabled());
            response.setVersion(responseThrift.getVersion());


            return response;


        }
    }
}
